<style lang="scss">
// @import '@/assets/css/variable';
</style>

<template>
  <div class="wrapperContent2" style="padding-bottom: 84px;">
    <van-form validate-first v-if="member" :show-error-message="false" label-width="90">
		<div class="fs-14 fc-333 titleLabel">个人基本信息</div>
		<van-field label="姓名" v-model="member.member_name" readonly/>
		<van-field label="身份证号" v-model="member.card_no" readonly/>
		<van-field label="年龄" v-model="member.age" readonly/>
		<van-field label="性别" v-model="member.gender==1?'男':'女'" readonly/>
		<van-field label="籍贯" v-model="member.card_address" readonly/>
		<van-field label="联系方式" v-model="member.member_mobile" readonly/>
		<div class="fs-14 fc-333 titleLabel">企业项目信息</div>
		<van-field v-model="member.company_name" maxlength="30" label="企业名称" readonly/>
		<van-field v-model="member.company_name" maxlength="30" label="企业注册年份" readonly/>
		<van-field v-model="member.legal_person_name" maxlength="20" label="法人" readonly/>
		<van-field v-model="member.person_types" maxlength="24" label="重点人群" readonly/>
		<van-field v-model="member.social_credit_code" maxlength="20" label="社会信用代码" readonly/>
		<van-field v-model="member.legal_person_name" maxlength="20" label="企业人数" readonly/>
    </van-form>
	<div class="fixed_bottom">
	  <van-button color="linear-gradient(to bottom, #6FC6FC, #1FA0F5)" round block @click="toView('/member/editUserInfo')">
	    去完善或修改
	  </van-button>
	</div>
  </div>
</template>
<script>
export default {
	name:'userInfo',
  components: {},
  data() {
    return {
      member:''
    };
  },
  created() {
	  console.log('created')
    this.member = this.$store.state.member || JSON.parse(localStorage.getItem('member'))
	this.member.age = this.$utils.calculateAge(this.member.card_no)
  },
  mounted() {
	  this.getAllMember()
  },
  methods:{
	  getAllMember() {
		  this.$request.getAllMember().then(res=>{
			  if(res.code == 200) {
				  Object.assign(this.member,res.data)
				  console.log('this.member',this.member)
			  }
		  })
	  },
    toView(path) {
		this.$router.push(path)
	}
  }
}

</script>